package com.sskj.fca.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.bean.UserBean;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.fca.http.HttpConfig;
import com.sskj.fca.ui.activity.UserInfoActivity;


public class UserInfoActivityPresenter extends BasePresenter<UserInfoActivity> {

    public void getUserInfo(String money_type) {
        httpService.userInfo(money_type)
                .tag(this)
                .execute(new JsonCallBack<HttpData<UserBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<UserBean>> response) {
                        HttpData httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            UserBean userBean = (UserBean) httpData.getData();
                            mView.updateUI(userBean);
                        }
                    }
                });
    }


}
